package com.shujia.utils;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;

import java.util.HashSet;

public class RedisTool {
    private RedisTool(){}

    public static JedisCluster getConnection(){
        HashSet<HostAndPort> hostAndPortHashSet = new HashSet<>();
        //public HostAndPort(String host, int port)
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7000));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7001));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7002));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7003));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7004));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7005));
        hostAndPortHashSet.add(new HostAndPort("192.168.233.101",7006));
        return new JedisCluster(hostAndPortHashSet);
    }
}
